package br.edu.fasete.javaroad.model.architeture;
import java.io.Serializable;

public class Variable implements Serializable{
	private static final long serialVersionUID = 1L;
	private String name;
	private String description;
	private String defaultValue;
	private String value;
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getDefaultValue() {
		return defaultValue;
	}
	public void setDefaultValue(String defaultValue) {
		this.defaultValue = defaultValue;
	}
	public Variable() {
	}
	public Variable(String description, String name, String defaultValue) {
		this.description = description;
		this.name = name;
		this.defaultValue = defaultValue;
	}
	@Override
	public boolean equals(Object arg0) {
		if(arg0 instanceof Variable)
			return this.getName().equalsIgnoreCase(((Variable) arg0).getName()); 
		return false;
	}
	
	public String toString() {
		return name;
	}
	
	public String getValue() {
		if(value==null || value.equals(""))
			return defaultValue;
		else
			return value;
	}
	
	public void setValue(String value) {
		this.value = value;
	}
	
	
}
